CORS support for preview thumbnails #2777
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to related issue (if applicable)
#2589
#2501
Summary of proposed changes
Hello Sam, thank you for taking the time to check out this PR.
Currently, plyr can't fetch preview thumbnails when they're stored on a secure CDN. To solve this, we simply need to set withCredentials to true on the xhr request object in the preview-thumbnails plugin.
The solution I've proposed will solve the use cases in the GitHub issues raised above about this. Jadson from issue #2589 did suggest a more elegant solution. However, as this codebase is using a custom fetch() function, it doesn't make sense to do it that way, perhaps in the future it could be considered.
I've tried my best to follow your coding and language style, and if you have any questions or require any changes please let me know.